import request from '@/utils/request'
import da from "element-ui/src/locale/lang/da";

// 查询采购单列表
export function listPurchaseInfo(query) {
  return request({
    url: '/business/purchaseInfo/list',
    method: 'get',
    params: query
  })
}
export function listApplyPurchaseInfo(query) {
  return request({
    url: '/business/purchaseInfo/applyList',
    method: 'get',
    params: query
  })
}

export function listPurchaseInfoSelect(query) {
  return request({
    url: '/business/purchaseInfo/selectList',
    method: 'get',
    params: query
  })
}

// 查询采购单详细
export function getPurchaseInfo(id) {
  return request({
    url: '/business/purchaseInfo/' + id,
    method: 'get'
  })
}

// 新增采购单
export function addPurchaseInfo(data) {
  return request({
    url: '/business/purchaseInfo',
    method: 'post',
    data: data
  })
}
export function addCaigoItemInfo(id) {
  return request({
    url: '/business/purchaseInfo/addCaigoItemInfo/' + id,
    method: 'get'
  })
}
// 修改采购单
export function updatePurchaseInfo(data) {
  //console.log(data)
  return request({
    url: '/business/purchaseInfo/updatePurchaseInfo',
    method: 'post',
    data: data
  })
}
// 审批采购单
export function shenpiPurchaseInfo(data) {
  //console.log(data)
  return request({
    url: '/business/purchaseInfo/shenpi',
    method: 'post',
    data: data
  })
}
// 采购单生成合同
export function htScPurchaseInfo(data) {
  return request({
    url: '/business/purchaseInfo/htsc',
    method: 'post',
    data: data
  })
}
// 采购单申请
export function applyPurchaseInfo(data) {
  return request({
    url: '/business/purchaseInfo/apply',
    method: 'post',
    data: data
  })
}

// 删除采购单
export function delPurchaseInfo(id) {
  return request({
    url: '/business/purchaseInfo/' + id,
    method: 'delete'
  })
}
